<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>-->
<!--<%-->
<!--String path = request.getContextPath();-->
<!--String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";-->
<!--%>-->

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <title>添加角色</title>

    <meta name="pragma" content="no-cache">
    <meta name="cache-control" content="no-cache">
    <meta name="content-type" content="text/html;charset=UTF-8">
    <meta name="expires" content="0">
    <link th:insert="~{views/script :: tiancai}"/>

</head>

<body style="width:100%;max-width:600px;padding:30px 60px;">
<section class="info-section">
    <form id="form" method="post">
        <table>
            <tr>
                <td class="text-title">角色名称：</td>
                <td class="text-content">
                    <input type="hidden" name="id" th:value="${systemRole.id }">

                    <input type="text" name="roleName" th:value="${systemRole.roleName }"
                           class="easyui-textbox theme-textbox-radius"
                           data-options="required:true,validType:'length[3,10]'">
                </td>
            </tr>
            <tr>
                <td class="text-title">排序编号：</td>
                <td class="text-content">
                    <input type="text" name="sortNum" th:value="${systemRole.sortNum }"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="text-title">角色状态：</td>
                <td class="text-content">
                    <select name="status" class="easyui-combobox theme-textbox-radius">
                        <option th:value=" ${systemRole.status==1 } ? 'selected' : '' ">正常</option>
                        <option th:value=" ${systemRole.status==0 } ? 'selected' : '' ">禁用</option>
                        <option th:value=" ${systemRole.status==2 } ? 'selected' : '' ">已删除</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-title">描述信息：</td>
                <td class="text-content">
                    <textarea class="theme-textbox-radius" rows="5" cols="20"
                              name="roleNote">[[${systemRole.roleNote }]]</textarea></td>
            </tr>

            <tr style="display: none;">
                <td colspan="2">
<!--                    <input type="hidden" name="roleName" th:value="${systemRole.roleName}">-->
<!--                    <input type="hidden" name="createBy" th:value="${systemRole.createBy}">-->
<!--                    <input type="hidden" name="createTime" th:value="${systemRole.createTime}">-->
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;margin-top: 10px;">
                    <a href="javascript:void(0);" id="saveBtn" class="easyui-linkbutton button-primary">保存</a>
                    <a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger">重置</a>
                </td>
            </tr>
        </table>
    </form>
</section>
<script type="text/javascript">
    $(function () {
        //重置按钮
        $("#resetBtn").on("click", function (event) {
            $("#form").form("reset");
        });

        //为保存按钮添加事件
        $("#saveBtn").on("click", function (event) {
            $("#form").form("submit", {
                url: "/system/role/RoleAction_saveOrUpdate.action",
                onSubmit: function () {
                    //调用easyui中form对象的validate方法对表单中数据进行校验，该方法返回boolean值，如果为false会阻止表单提交
                    return $("#form").form("validate");
                },
                success: function (data) {
                    var obj = eval("(" + data + ")");
                    if (obj.success) {
                        $.messager.alert("提示", obj.message);
                        parent.closeTopWindow();
                    } else {
                        $.messager.alert("警告", obj.message);
                    }
                }
            });
        });

    });

</script>
</body>
</html>


<!--Unexpected token '<'  -->